package nc.ui.jxys.cktz;

import java.awt.Container;

import nc.ui.pub.ClientEnvironment;
import nc.ui.trade.controller.IControllerBase;
import nc.ui.zmpub.pub.bill.MBillSourceDLG;
import nc.vo.trade.pub.IBillStatus;

public class BillSourceDlg extends MBillSourceDLG{
	/**
	 * 
	 */
	private static final long serialVersionUID = 4791039515957546124L;
	public BillSourceDlg(String pkField, String pkCorp, String operator,
			String funNode, String queryWhere, String billType,
			String businessType, String templateId, String currentBillType,
			Container parent) {
		super(pkField, pkCorp, operator, funNode, queryWhere, billType, businessType,
				templateId, currentBillType, parent);
	}
	//xew_proaccept  xew_proaccept_b
	public String getHeadCondition() {
		//ys_cktz_h
			String sql=null;	
			return sql=
		//		 " ys_cktz_h.planversion is not null ) and ys_cktz_h.vbillstatus= "+IBillStatus.CHECKPASS+
				 " ys_cktz_h.planversion='DQ' ) and ys_cktz_h.vbillstatus="+IBillStatus.CHECKPASS+
				 " and ys_cktz_h.pk_cktz_h not in (select ys_cktz_h.pk_cktz_h from ys_cktz_h  join ys_cktz_b " +
				 " on ys_cktz_h.pk_cktz_h=ys_cktz_b.pk_cktz_h where ys_cktz_h.pk_corp='"+ClientEnvironment.getInstance().getCorporation().getPrimaryKey()+"'" +
				 " and ( coalesce(nplanexenum,0)>0  or coalesce(nassplanexenum,0)>0 " +
				 " or coalesce(nexemy,0)>0)";
		}
	protected boolean isHeadCanMultiSelect() {
		return false;
	}
	
	protected boolean isBodyCanMultiSelect() {
		return false;
	}
	
	protected boolean isBodyCanSelected() {
		return false;
	}
	
	@Override
	public String getPk_invbasdocName() {
		return "pk_invbasdoc";
	}
	
	@Override
	public String getPk_invmandocName() {
		return "pk_invmandoc";
	}
	
	@Override
	public IControllerBase getUIController() {
		return new nc.ui.jxys.ckplan.Controller();
	}	
}
